home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / bastoftn / basconv.doc < prev   
Text File  |  1984-10-23  |  5KB  |  138 lines

  1.         BASCONV--A FORTRAN-TO-BASIC    CONVERSION AID
  2.                BY JIM GLASS
  3.  
  4.  
  5. BASCONV     is  a    program    for converting IBM-PC Basic programs into
  6. Microsoft or IBM Fortran. It will not perform every detail of the
  7. conversion  for     you,  but will    perform    the bulk of the    drudgery.
  8. Careful     inspection  and editing of the    resulting output file are
  9. vital if you wish to obtain a working Fortran program.
  10.  
  11. BASCONV     is  easy  to use. It asks you for the name of the source
  12. (Basic)     file, the target (Fortran) file, and if you wish to have
  13. the  source  displayed    as  it is being    converted. All file names
  14. must be    supplied complete with drive identifier    and extension, if
  15. any.  In  addition  to these files, BASCONV also builds    a working
  16. file,  called  WORK,  on  the  current default drive. It DOES NOT
  17. delete the WORK    file when the conversion is complete.
  18.  
  19. BASCONV    is fairly smart.  Among    the things it can do are:
  20.  
  21.      Change     FOR/NEXT  loops  into    DO  loops.
  22.      BASCONV  supplies target line numbers for
  23.      the terminating CONTINUE if necessary.
  24.  
  25.      Change    WHILE/WEND loops into IF..CONTINUE
  26.      loops.
  27.  
  28.      Change     ON  n    GOTO  statements into GOTO
  29.      (...)    n  type    statements. ON...GOSUB and
  30.      GOSUBS    in general are NOT converted.
  31.  
  32.      Fully parse IF..THEN..ELSE statements and
  33.      convert  into    equivalent Fortran logical
  34.      IF statements or IF blocks. An    IF without
  35.      an ELSE becomes a pure    logical    IF.
  36.  
  37.      Handle        OPEN..FOR..AS     and     OPEN
  38.      mode,file,... statements, converting them
  39.      into Fortran OPEN statements.
  40.  
  41.      Detect      ALL    implicit  declarations    of
  42.      variables,    and    provide      explicit
  43.      declarations  at  the    beginning  of  the
  44.      Fortran source.
  45.  
  46.      Convert  all  keywords,  such    as ATN,    to
  47.      equivalents,  such  as     ATAN.    Also parse
  48.      statements  such  as  x MOD y and convert
  49.      into statements such as AMOD(x,y).
  50.  
  51.      Remove     all  Basic  line  numbers, except
  52.      where    lines  are  explicitly referenced.
  53.      These     line    numbers      become   Fortran
  54.      statement labels.
  55.  
  56.      Break    all  mulit-statement  Basic  lines
  57.      into    single    statements  and     move  all
  58.      source    code into column seven as required
  59.      by Fortran.
  60.  
  61.      Convert all double-quotes (") into single
  62.      quotes    (').
  63.  
  64.      Convert  Basic     exponentiation     (^)  into
  65.      Fortran exponentiation    (**).
  66.  
  67.      Provide  Fortran  statement functions for
  68.      the Basic logical functions IMP, XOR, and
  69.      EQV.
  70.  
  71.      Converts  PRINT  and  LPRINT  as  well    as
  72.      PRINT#    and WRITE# statements into Fortran
  73.      equivalents.
  74.  
  75.      Inserts  appropriate  code to convert the
  76.      Basic      SWAP      keyword   into   Fortran
  77.      statements.
  78.  
  79.      Converts  all    Basic relational operators
  80.      such  as <,>,=,NOT,AND,OR into    equivalent
  81.      Fortran          such        as
  82.      .LE.,.GT.,.EQ.,.NOT.,.AND.,.OR.
  83.  
  84. Some things BASCONV (at    least version 1.0) CANNOT do are:
  85.  
  86.      Convert  Basic     graphics commands such    as
  87.      LINE, PSET, PRESET.
  88.  
  89.      Convert GOSUBS    into CALLS
  90.  
  91.      Convert   PRINT  USING     into  WRITE  with
  92.      FORMAT.
  93.  
  94.      Handle    DATA/RESTORE/READ statements.
  95.  
  96.      Handle       CHAIN,    LSET,    MKI$,   CVI,
  97.      statements.
  98.  
  99.      Handle     sceen positioning statements like
  100.      POS(0), CSRLIN.
  101.  
  102.  
  103. Here  is  a list of the    Basic keywords which ARE NOT converted by
  104. BASCONV:
  105.  
  106. AUTO     BLOAD     BSAVE     CALL      CHAIN      CIRCLE  CLEAR      CLS
  107. COLOR     COM     COMMON     CONT      CSRLIN  CVD      CVI      DATA
  108. DATE$     DELETE     DRAW     EDIT      ERASE      ERL      ERR      ERROR
  109. FIELD     FILES     FRE     GET      GOSUB      HEX$      INKEY$  INP
  110. INPUT$     INSTR     KEY     KEY$      KILL      LEFT$      LEN      LINE
  111. LIST     LLIST     LOAD     LOC      LOCATE  LOF      LPOS      LSET
  112. MERGE     MID$     MKD$     MKI$      MKS$      MOTOR      NAME      NEW
  113. OCT$     OFF     OPTION     OUT      PAINT      PEEK      PEN      PLAY
  114. POINT     POS     PRESET     PSET      PUT      RANDOMIZE      RENUM
  115. RESTORE     RESUME     RIGHT$     RND      RESET      RUN      SAVE      SCREEN
  116. SOUND     SPACE$     SPC(     STICK      STRIG      STRING$ SYSTEM  TAB(
  117. TIME$     TROFF     TRON     USING      USR      VAL      VARPTR  VARPTR$
  118. WAIT     WIDTH
  119.  
  120. Finally,  here    is a list of the Basic keywords    which ARE handled
  121. by BASCONV:
  122.  
  123. ABS     AND     ASC     ATN      CDBL      CHR$      CINT      CLOSE
  124. COS     CSNG     DEF     DEFDBL      DEFINT  DEFSNG  DEFSTR  DIM
  125. ELSE     END     EQV     EXP      FIX      FNxxxx  FOR      GOTO
  126. IF     IMP     INPUT     INPUT#      INT      LET      LOG      LPRINT
  127. MOD     NEXT     NOT     ON..GOTO OPEN      OR      PRINT      PRINT#
  128. REM     RETURN     SGN     SIN      SQR      STEP      STOP      STR$
  129. SWAP     TAN     THEN     TO      WEND      WHILE      WRITE      WRITE#
  130. XOR
  131.  
  132. Although  the  list  of    keywords recognized by BASCONV is shorter
  133. than  those not    recognized, the    most important are there. Many of
  134. the  unrecognized  words  are  those with no Fortran equivalents,
  135. such  as  LINE    or  PAINT.  A  few  are     not  handled  due to the
  136. difficulty    of    programming       the      conversion,    such   as
  137. DATA/READ/RESTORE. Perhaps in Version 1.1...
  138.